<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- saved from url=(0030)http://t.163.com/app/list/life -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<title>G305实验室交流平台</title>
<meta name="Keywords" content="g305">
<meta name="Description" content="g305实验室交流平台">

<link rel="stylesheet" type="text/css"
	href="../../static/common1.2.4.css">

<link rel="stylesheet" href="../../static/oauth1.0.3.css"
	type="text/css">
<script type="text/javascript" src="../../static/ntes_jslib_1.4.4.js"
	charset="utf-8"></script>
<link type="text/css" rel="stylesheet"
	href="chrome-extension://cpngackimfmofbokmjmljamhdncknpmg/style.css">
<script type="text/javascript" charset="utf-8"
	src="chrome-extension://cpngackimfmofbokmjmljamhdncknpmg/page_context.js"></script>
	
	
	
	
	
	
	<script type="text/javascript">
	function check_username(str) {
		var check_username=document.getElementById("check_username")
		flag=true;
		if (str == ""){
			check_username.innerHTML = "<img src=\"../../static/img/check_error.png\" align=\"middle\">用户名不能为空";
			flag=false;
		}else if(str.length<1){
			check_username.innerHTML = "<img src=\"../../static/img/check_error.png\" align=\"middle\">用户名最少为3个字符";
			flag=false;
		}else{
			check_username.innerHTML = "<img width=\"40\"  height=\"40\" src=\"../../static/img/progress_bar.gif\" >";
			if(exist_user(str)){
				check_username.innerHTML = "<img src=\"../../static/img/check_error.png\" align=\"middle\">用户名已经存在";
				flag=false;
			}else{
				check_username.innerHTML = "<img src=\"../../static/img/check_success.png\" align=\"middle\">";
			}
			
		}
		
		return flag;
	}
	function check_email(str) {
		var check_email=document.getElementById("check_email")
		flag=true;
		if (str == ""){
			check_email.innerHTML = "<img src=\"../../static/img/check_error.png\" align=\"middle\">真实姓名不能为空";
			flag=false;
		}else if(str.length<1){
			check_email.innerHTML = "<img src=\"../../static/img/check_error.png\" align=\"middle\">真实姓名最少为3个字符";
			flag=false;
		}else{
			check_email.innerHTML = "<img src=\"../../static/img/check_success.png\" align=\"middle\">";
		}
		
		return flag;
	}
	function check_password(str) {
		var check_password=document.getElementById("check_password")
		flag=true;
		if (str == ""){
			check_password.innerHTML = "<img src=\"../../static/img/check_error.png\" align=\"middle\">密码不能为空";
			flag=false;
		}else if(str.length<1){
			check_password.innerHTML = "<img src=\"../../static/img/check_error.png\" align=\"middle\">密码最少为3个字符";
			flag=false;
		}else{
			check_password.innerHTML = "<img src=\"../../static/img/check_success.png\" align=\"middle\">";
		}
		
		return flag;
	}
	function check_password1(str) {
		var check_password1=document.getElementById("check_password1")
		var str1=document.getElementById("password").value
		flag=true;
		if (str!=str1){
			check_password1.innerHTML = "<img src=\"../../static/img/check_error.png\" align=\"middle\">两次输入的密码不一样";
			flag=false;
		}else{
			check_password1.innerHTML = "<img src=\"../../static/img/check_success.png\" align=\"middle\">";
		}
		
		return flag;
	}
	
	function checkAll() {
		var username=document.getElementById("username").value;
		var email=document.getElementById("email").value;
		var password=document.getElementById("password").value;
		var password1=document.getElementById("password1").value;
		var flag=check_username(username);
		if(flag)
			flag=check_email(email);
		if(flag)
			flag=check_password(password);
		if(flag)
			flag=check_password1(password1);
		
		return flag;
	}
	
	function exist_user(username) {
		var xmlhttp;
		if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
			xmlhttp = new XMLHttpRequest();
		} else {// code for IE6, IE5
			xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		}
		xmlhttp.open("GET", "/user/check_user.do?username="+username, false);
		xmlhttp.send();
		var result = xmlhttp.responseText;
		if(result=="true")
			return true;
		else 
			return false;
	}
</script>
	

	
</head>

<body screen_capture_injected="true">

	
	<div class="global-nav" id="globalNav">
		<div class="global-nav-inner">
		<form action="/user/login.do">
			<ul class="global-nav-left">
				<li class="item">
					<a href="/index.do">首页</a>&nbsp;&nbsp;&nbsp;
				</li>
				<li class="item">
					<label>用户名：</label><input type="text" name="username"/>
				</li>
				<li class="item">
					<label>密码：</label><input type="password" name="password"/>
				</li>
				<li class="item">
					<input type="submit" value="登录"/>
				</li>
			</ul>
		</form>
		</div>
	</div>

	<div class="header">
		<div class="header-inner">
			<a class="sub-logo oauth-logo" href="#" title="G305"></a>
		</div>
	</div>
			<center>
			<p>
			<img width="50" height="50" alt="G305光环" src="../../static/img/progress_bar.gif" align="right">
			<font size="7" color="red">G</font><font size="5" color="green">3</font><font
				size="5" color="#ff00ff">0</font><font size="5" color="#9400d3">5</font><font
				size="5">成员注册</font>
		    <img width="50" height="50" alt="G305光环" src="../../static/img/progress_bar.gif" align="left">
		</p>
				<form action="/user/register.do" method="post" onsubmit="return checkAll();">
	           		<table>
	           			<tr  height="10">
	           				<td><label><font size="3">昵称：</font></label></td>
	           				<td >
	           					<p><input type="text" name="username"  id="username" size="40"  style="height:20px" onblur="check_username(this.value)">
	           					<span id="check_username"><font color="red" size="5">*</font></span></p>
	           				</td>
	           			</tr>
	           			<tr  height="10">
	           				<td><label><font size="3">邮箱：</font></label></td>
	           				<td >
		           				<input type="text" name="email"  id="email" size="40"  style="height:20px"  onblur="check_email(this.value)">
		           				<span id="check_email"><font color="red"size="5">*</font></span>
	           				</td>
	           			</tr>
	           			<tr height="10">
	           				<td><label><font size="3">密码：</font></label></td>
	           				<td>
	           					<p>
			           				<input type="password" name="password"  id="password"  size="40" style="height:20px" onblur="check_password(this.value)">
			           				<span id="check_password"><font color="red"size="5">*</font></span>
		           				</p>
							</td>
	           			</tr>
	           			<tr height="10">
	           				<td><label><font size="3">确认密码：</font></label></td>
	           				<td>
	           					<p>
		           					<input type="password" name="password1"  id="password1" size="40" style="height:20px"  onblur="check_password1(this.value)">
		           					<span id="check_password1"><font color="red"size="5">*</font></span>
	           					</p>
	           				</td>
	           			</tr>
	           		</table>
	           		<br/>
	           		<input type="submit" value="注册">&nbsp;&nbsp;&nbsp;<a href="/user/login_view.do">登录</a>
           		</form>
            </center>
			
	<jsp:include page="../templete/footer.jsp"></jsp:include>
</body>
</html>